<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
    <svg-icon icon-class="dashboard" />
    <svg-icon icon-class="kucha" />
    <svg-icon icon-class="kucha" />
    <svg-icon icon-class="kucha" />
    自定义指令 <input v-focus="'aaa'" type="text">
    <button @click="hAddRoutes">动态路由添加</button>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  methods: {

    hAddRoutes() {
      // 动态路由添加
      this.$router.addRoutes([
        {
          path: '/demo2',
          component: () => import('@/views/demo/demo.vue')
        }
      ])
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
